<template>
  <div>
    <!-- 头部 --start-->
    <div class="nav">
      <!-- <p v-if="state==true">
        <span>.</span> 考勤核对
      </p>-->
      <p>
        <span>.</span> 考勤详情
      </p>
      <div id="nav_go">
        <el-button type="info" icon="el-icon-back" class="btn_fanhui" @click="revert()">返回</el-button>
      </div>
    </div>
    <!-- 头部 --end-->
    <div id="table_conter">
      <div class="title">{{item.depart}}{{item.year}}年{{item.month}}月考勤表</div>
      <div>
        <template>
          <el-table :data="tableData" style="width: 98%;margin:0 auto;" height="550">
            <!-- <el-table-column label="一车间2019年11月份考勤表"> -->
            <el-table-column prop="Name" label="姓名" width="70"></el-table-column>
            <el-table-column label="01">
              <el-table-column prop="state1" label="A" width="22"></el-table-column>
              <el-table-column prop="state2" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="02">
              <el-table-column prop="state3" label="A" width="22"></el-table-column>
              <el-table-column prop="state4" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="03">
              <el-table-column prop="state5" label="A" width="22"></el-table-column>
              <el-table-column prop="state6" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="04">
              <el-table-column prop="state7" label="A" width="22"></el-table-column>
              <el-table-column prop="state8" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="05">
              <el-table-column prop="state9" label="A" width="22"></el-table-column>
              <el-table-column prop="state10" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="06">
              <el-table-column prop="state11" label="A" width="22"></el-table-column>
              <el-table-column prop="state12" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="07">
              <el-table-column prop="state13" label="A" width="22"></el-table-column>
              <el-table-column prop="state14" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="08">
              <el-table-column prop="state15" label="A" width="22"></el-table-column>
              <el-table-column prop="state16" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="09">
              <el-table-column prop="state17" label="A" width="22"></el-table-column>
              <el-table-column prop="state18" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="10">
              <el-table-column prop="state19" label="A" width="22"></el-table-column>
              <el-table-column prop="state20" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="11">
              <el-table-column prop="state21" label="A" width="22"></el-table-column>
              <el-table-column prop="state22" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="12">
              <el-table-column prop="state23" label="A" width="22"></el-table-column>
              <el-table-column prop="state24" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="13">
              <el-table-column prop="state25" label="A" width="22"></el-table-column>
              <el-table-column prop="state26" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="14">
              <el-table-column prop="state27" label="A" width="22"></el-table-column>
              <el-table-column prop="state28" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="15">
              <el-table-column prop="state29" label="A" width="22"></el-table-column>
              <el-table-column prop="state30" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="16">
              <el-table-column prop="state31" label="A" width="22"></el-table-column>
              <el-table-column prop="state32" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="17">
              <el-table-column prop="state33" label="A" width="22"></el-table-column>
              <el-table-column prop="state34" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="18">
              <el-table-column prop="state35" label="A" width="22"></el-table-column>
              <el-table-column prop="state36" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="19">
              <el-table-column prop="state37" label="A" width="22"></el-table-column>
              <el-table-column prop="state38" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="20">
              <el-table-column prop="state39" label="A" width="22"></el-table-column>
              <el-table-column prop="state40" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="21">
              <el-table-column prop="state41" label="A" width="22"></el-table-column>
              <el-table-column prop="state42" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="22">
              <el-table-column prop="state43" label="A" width="22"></el-table-column>
              <el-table-column prop="state44" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="23">
              <el-table-column prop="state45" label="A" width="22"></el-table-column>
              <el-table-column prop="state46" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="24">
              <el-table-column prop="state47" label="A" width="22"></el-table-column>
              <el-table-column prop="state48" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="25">
              <el-table-column prop="state49" label="A" width="22"></el-table-column>
              <el-table-column prop="state50" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="26">
              <el-table-column prop="state51" label="A" width="22"></el-table-column>
              <el-table-column prop="state52" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="27">
              <el-table-column prop="state53" label="A" width="22"></el-table-column>
              <el-table-column prop="state54" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="28">
              <el-table-column prop="state55" label="A" width="22"></el-table-column>
              <el-table-column prop="state56" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="29">
              <el-table-column prop="state57" label="A" width="22"></el-table-column>
              <el-table-column prop="state58" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="30">
              <el-table-column prop="state59" label="A" width="22"></el-table-column>
              <el-table-column prop="state60" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="31">
              <el-table-column prop="state561" label="A" width="22"></el-table-column>
              <el-table-column prop="state62" label="B" width="22"></el-table-column>
            </el-table-column>
            <el-table-column label="出勤">
              <el-table-column prop="ckeck1" label="√" width="23"></el-table-column>
            </el-table-column>
            <el-table-column label="旷工">
              <el-table-column prop="ckeck2" label="×" width="23"></el-table-column>
            </el-table-column>
            <el-table-column label="事假">
              <el-table-column prop="ckeck3" label="△" width="23"></el-table-column>
            </el-table-column>
            <el-table-column label="病假">
              <el-table-column prop="ckeck4" label="○" width="23"></el-table-column>
            </el-table-column>
            <el-table-column label="加班">
              <el-table-column prop="ckeck5" label="﹢" width="23"></el-table-column>
            </el-table-column>
            <el-table-column label="迟到">
              <el-table-column prop="ckeck6" label="L" width="23"></el-table-column>
            </el-table-column>
            <el-table-column label="早退">
              <el-table-column prop="ckeck7" label="E" width="23"></el-table-column>
            </el-table-column>
            <el-table-column label="出差">
              <el-table-column prop="ckeck8" label="T" width="23"></el-table-column>
            </el-table-column>
            <el-table-column prop="ckeck9" label="备注" width="100"></el-table-column>
          </el-table>
        </template>
      </div>
    </div>
    <!-- <div class="buttom" v-if="state==true">
      <el-button type="primary" size="medium" @click="pass(1)">通过</el-button>
      <el-button type="info" size="medium" @click="pass(2)">驳回</el-button>
    </div>
    <div class="buttom" v-else>
      <el-button type="primary" size="medium">确认</el-button>
      <el-button type="info" size="medium">返回</el-button>
    </div>-->
  </div>
</template>
<script>
import axios from "axios";
export default {
  data () {
    return {
      id: "",
      item: { depart: "", year: "", month: "", },
      tableData: [],
      arr: []
    };
  },
  created () {
    this.id = this.$route.query.e;
    this.getxq();
  },
  methods: {
    //返回
    revert () {
      this.$router.go(-1);
    },
    //详情数据
    getxq () {
      var obj = { id: this.id };
      var objs = JSON.stringify(obj); let the = { index: 13, jsondata: objs };
      console.log(objs)
      axios.post("/apis/PersonnelMatters.asmx/GetData", the).then(({ data }) => {
        var list = JSON.parse(data.d);
        if (list == null) { this.$message.error("数据异常"); }
        else {
          this.item = list.basemess;
          this.tableData = list.det
        }
      })
    },
    //通过驳回
    pass (a) {
      let arr = { id: 2, date: this.date, depart: this.depart, sid: a };
      let arr1 = JSON.stringify(arr);
      axios(
        "apis/PersonnelManagement.asmx/Checkingin?index=3&jsondata=" +
        arr1 +
        "&empno=" +
        this.empno
      ).then(({ data }) => {
        let data1 = this.$x2js.xml2js(data);
        let data3 = data1.string.__text;
        console.log(data3);
        if (data3 == "核对成功") {
          this.$message({
            message: "核对成功",
            type: "success"
          });
        }
        this.$router.go(-1);
        if (data3 == "已驳回") {
          this.$message.error("已驳回");
        }
        this.$router.go(-1);
      });
    }
  }
};
</script>
<style lang="scss" scoped>
@import '@/assets/scss/base.scss';
.nav {
  //border: solid 1px red;
  height: 60px;
  padding: 0 1%;
  position: relative;
  p {
    height: 40px;
    margin: 10px 0;
    line-height: 40px;
    span {
      background: $Header_color;
      color: $Header_color;
    }
  }
  #nav_go {
    position: absolute;
    top: 10px;
    right: 1%;
    img {
      height: 16px;
      padding-right: 10px;
    }
  }
}
.buttom {
  text-align: center;
  margin-top: 10px;
}
#table_conter{background: #fff;width: 98%;margin:0 auto;padding: 10px 0;}
#table_conter .title {
  text-align: center;
  height: 50px;
  line-height: 50px;

}
</style>
<style >
#table_conter .el-table thead.is-group th {
  background: #fff;
}
#table_conter .el-table th > .cell {
  text-align: center;
  padding: 0;
}
#table_conter .el-table {
  font-size: 14px;
}
#table_conter .el-table td,
.el-table th {
  padding: 0;
  height: 40px;
}
#table_conter .el-table .cell {
  line-height: normal;
  padding: 0;
}
#table_conter .el-table .cell,
.el-table--border td:first-child .cell,
.el-table--border th:first-child .cell {
  padding: 0;
}
#table_conter .el-table th.gutter {
  display: table-cell !important;
}
#table_conter .el-table .cell {
  text-align: center;
}
</style>